<template>
  <div class="Progress-Chart" ref="ProgressChart"></div>
</template>

<script lang="ts">
export default {
  name: "ProgressChart",
};
</script>

<script lang="ts" setup>
import { ref, onMounted } from "vue";
import * as echarts from "echarts";

const ProgressChart = ref();

onMounted(() => {
  const myEcharts = echarts.init(ProgressChart.value);
  const option = {
    color: ["#eeeeee"],
    xAxis: {
      // 隐藏
      show: false,
      // 坐标轴左右留白
      boundaryGap: false,
      min: 0,
      max: 100,
    },
    tooltip: {},

    yAxis: {
      // 隐藏
      show: false,
      data: ["百分比"],
    },
    // tooltip: {},
    series: {
      type: "bar",
      data: [30],
      showBackground: true, // 柱条背景色
      barWidth: 10, //可以设置柱形图的  柱子的大小 高宽
      itemStyle: {
        color: "#9acd32",
      },
      label: {
        // 提示文字
        show: true,
        position: "right",
        formatter: "|",
        color: "#9acd32",
      },
    },
    grid: {
      top: 0,
      bottom: 0,
      left: 0,
      right: 0,
    },
  };
  myEcharts.setOption(option);
});
</script>

<style scoped>
.Progress-Chart {
  height: 50px;
}
</style>
